<template>
	<view>
		<view class="gui-bold gui-text-center gui-margin">{{info.info_theme}}</view>
		<view class="gui-margin text">{{info.info_text}}</view>
		<view class="gui-fixed-lb" style="width: 100%;" v-if="info.link_id">
			<button type="primary" @click="goto()">快速跳转</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				mid: '',
				infoType: '',
				info: {}
			}
		},
		onLoad(opt) {
			console.log("opt", opt)
			this.mid = opt.id
			this.infoType = opt.info_type
			console.log(this.mid)
			this.getDetail();
		},
		methods: {
			getDetail() {
				let self = this
				let data = {
					id: self.mid,
					info_type: self.infoType
				}
				this.$boya.NGet("/app/msg_info/view", data, (res) => {
					console.log('res', res.data)
					self.info = res.data
					console.log(self.info)
				})
			},
			goto() {
				switch (this.info.info_type.toString()) {
					case "12":
						uni.navigateTo({
							url: "/pages/home/notice/notice?id=" + this.info.link_id
						})
						break;
					case "11":
						uni.navigateTo({
							url: "/pages/news/newsDetail?id=" + this.info.link_id
						})
						break;
					case "13":
						uni.navigateTo({
							url: "/pages/home/Active/active?id=" + this.info.link_id
						})
						break;
				}
			}
		}
	}
</script>

<style>
	.text {
		/* letter-spacing: 6rpx; */
		line-height: 60rpx;
	}
</style>